home *** CD-ROM | disk | FTP | other *** search
- Path: news.pi.se!usenet
- From: Ake Wallin <aw@medonic.se>
- Newsgroups: comp.lang.c++
- Subject: Re: prob. exporting functions in Borland C++ into DLL
- Date: 19 Jan 1996 19:30:31 GMT
- Message-ID: <4dorgn$afs@news.pi.se>
- NNTP-Posting-Host: d111.sth.pi.se
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
-
- televis@aix1.danadata.dk (Thomas Zaschke) writes:
- > My problem:
- >
- > I am writing a Windows-DLL (16-bit), to be used by a non-C application.
- > All my sources are compiled with Borlands C++ compiler from within
- > Borland C++ 4.53. All extensions are *.cpp.
- >
- > I want to export a function "MyFunc".
- >
- > 1) When using "_export" before the function-name, the resulting DLL does
- > not
- > content the name "MyFunc" as i would expect, but something like
- > "MyFunc$QV".
- >
- > 2) When using a .def file and exporting "MyFunc" explicitly, i get this
- > error
- > message "Attempt to export non-public symbol <myfunction-name>".
- >
- > I do not experience these problems when compiling and linking pure
- > C-source.
- >
- > My question is:
- >
- > How can I export "MyFunc" in a DLL and be sure that other applications
- > actually can see the correct name: "MyFunc" ?
- >
- > If I am forced to use a .def file (to export by ordinal), how do I get
- > this
- > to work without the before mentioned error ?
- >
- >
- > Thomas Zaschke
- > televis@aix1.danadata.dk
- >
- C++ mangles function names ( to allow overloading). If you need to use a C++ function
- outside C++ you must declare it as extern "C".
- Regards,
- Ake
-